import './init'
import angular from 'angular'
import '../../../../contract/pages/server'
import 'angular-route'
import '../../../../contract/pages/base/base-ctrl'
import '../../../../contract/pages/balance/balance-ctrl'
import './editinc/docs-ctrl'
import '../../../../contract/pages/dredge/dredge-ctrl'
import '../../../../contract/pages/income/income-ctrl'
import './editinc/performance-ctrl'
import './editinc/payinfo-ctrl'
import '../../../../contract/pages/receivable/receivable-ctrl'
import '../authorize'
import './contract-menu'
import '../../../../contract/pages/rent_detail'
import '../side'

angular.module('myContractEditApp')
    .service('userAuth', ['$http', ($http) => {
        return {
            reqUserAuth() {
                return $http.get(
                    '/api/index.php?r=user-auth/get-user-all-auth'
                );
            }
        };
    }])
    .config(['$routeProvider', function ($routeProvider) {
        $routeProvider
            .when('/base', {
                template: require('../../../../contract/pages/base/base.html')
            })
            .when('/income', {
                template: require('../../../../contract/pages/income/income.html')
            })
            .when('/receivable', {
                template: require('../../../../contract/pages/receivable/receivable.html')
            })
            .when('/balance', {
                template: require('../../../../contract/pages/balance/balance.html')
            })
            .when('/docs', {
                template: require('../../../../contract/editinc/docs.html')
            })
            .when('/dredge', {
                template: require('../../../../contract/pages/dredge/dredge.html')
            })
            .when('/performance', {
                template: require('../../../../contract/editinc/performance.html')
            })
            .when('/payinfo', {
                template: require('../../../../contract/editinc/payinfo.html')
            })
            .when('/rent_detail', {
                template: require('../../../../contract/pages/rent_detail/rent_detail.html')
            });
    }])
    .controller('appAuthList', ['$rootScope', function ($rootScope) {
        
    }])
    .run(function ($routeParams, contractMenuService) {
        contractMenuService.menuInit();
    });

angular.bootstrap(window.document, ['myContractEditApp']);
